package com.liug.droidsmall2.utils.system;

import android.os.CountDownTimer;
import android.widget.TextView;

/* 定义一个倒计时的内部类 */
public class TimeCount extends CountDownTimer {
	TextView tv;

	public TimeCount(long millisInFuture, long countDownInterval, TextView mtv) {
		super(millisInFuture, countDownInterval);// 参数依次为总时长,和计时的时间间隔
		tv = mtv;
	}

	@Override
	public void onFinish() {// 计时完毕时触发
		tv.setText("重新验证");
		tv.setClickable(true);
	}

	@Override
	public void onTick(long millisUntilFinished) {// 计时过程显示
		tv.setText(millisUntilFinished / 1000 + "秒");
		tv.setClickable(false);
	}
}